/*******************************************************************************
 * Copyright (c) 2007 University of Oslo.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     University of Oslo - initial API and implementation
 *******************************************************************************/

package com.cea.papyrus.diagram.sequence.sedi.edit.manager;


import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.tools.CellEditorLocator;
import org.eclipse.uml2.uml.Message;

import com.cea.papyrus.diagram.sequence.sedi.editor.message.MessageParser;
import com.cea.papyrus.diagram.sequence.sedi.model.util.ModelUtil;
import com.cea.papyrus.diagraminterchange2.di2.GraphEdge;

/**
 * Direct edit manager for Messages
 * 
 * @author frankd@ifi.uio.no
 */
public class MessageEditManager extends LabelDirectEditManager {
    public MessageEditManager(GraphicalEditPart source, CellEditorLocator locator) {
        super(source, locator);
    }

    @SuppressWarnings("unchecked")
    protected String getInitialEditorText() {
        GraphEdge editPart = (GraphEdge) getEditPart().getModel();
        return MessageParser.formatForEdit(ModelUtil.<Message> getSemantic(editPart));
    }
}
